package com.net.all.testing;


public class Testing 
{
	String str1 = "JAVA";
	String str2 = "UNIX";
	
	Thread t1 = new Thread(){
		public void run(){
			while(true)
			{
				synchronized (str1) 
				{
				  synchronized (str2) {
					System.out.println(str1 + str2);
				}	
				}
			}
		}
		
	};
	
	
	Thread t2 = new Thread(){
		public void run(){
			while(true)
			{
				synchronized (str2) 
				{
				  synchronized (str1) {
					System.out.println(str2 + str1);
				}	
				}
			}
		}
		
	};
	
	
	
	
	public static void main(String arg[])
	{
		Testing test = new Testing();
		test.t1.start();
		test.t2.start();
	}
}